﻿using System;
using System.IO;
using System.Text.RegularExpressions;
using WeatherRetriever;

namespace RetrieverTester
{
    class Program
    {
        static void Main(string[] args)
        {
            WeatherGetter getter = WeatherGetter.CreateNew();
            getter.Get();
            WeatherSoundPlayer player = WeatherSoundPlayer.CreateNew(@"C:\Users\Will\Documents\Visual Studio 2012\Projects\Wakeup\WeatherRetriever\sound");
            player.Play(getter.Result);
            //Weather res = getter.Result;
            //Weather res = WeatherGetter.GetWeather();
            //Console.WriteLine("Temp: {0}", res.Temperature);
            //Console.WriteLine("Skytext: {0}", res.Condition);
            //Console.WriteLine("Feelslike: {0}", res.FeelsLike);
            //Console.WriteLine("Humidity: {0}", res.Humidity);
            //Console.WriteLine("Wind: {0}", res.WindCondition);
            //string matchText = @"current temperature=_80_ skycode=_31_ skytext=_Clear_ date=_2012-10-17_ day=_Wednesday_ shortday=_Wed_ observationtime=_19:53:00_ observationpoint=_College Station, Easterwood Field_ feelslike=_84_ humidity=_74_ windspeed=_0_ winddisplay=_0 mph_";
            //string matchText = @"<?xml version=_1.0_ ?><weatherdata><weather weatherlocationcode=_wc:USTX0270_ weatherlocationname=_College Station, TX_ zipcode=_77840_ encodedlocationname=_College+Station%2c+TX_ url=_http://local.msn.com/weather.aspx?eid=1316029&amp;q=College+Station-TX&amp;zip=77840_ imagerelativeurl=_http://blu.stc.s-msn.com/as/wea3/i/en-us/_ degreetype=_F_ provider=_iMap_ attribution=_Data provided by iMap_ attribution2=_?? iMap_ lat=_30.6281567_ long=_-96.3371201_ timezone=_-5_ alert=__ entityid=_1316029_><current temperature=_80_ skycode=_31_ skytext=_Clear_ date=_2012-10-17_ day=_Wednesday_ shortday=_Wed_ observationtime=_19:53:00_ observationpoint=_College Station, Easterwood Field_ feelslike=_84_ humidity=_74_ windspeed=_0_ winddisplay=_0 mph_ /><forecast low=_57_ high=_89_ skycodeday=_30_ skytextday=_Partly Cloudy_ date=_2012-10-17_ day=_Wednesday_ shortday=_Wed_ precip=_0_ /><forecast low=_52_ high=_80_ skycodeday=_34_ skytextday=_Mostly Sunny_ date=_2012-10-18_ day=_Thursday_ shortday=_Thu_ precip=_0_ />";

            //Regex pattern = new Regex(@"current temperature=.(?<temp>\d+).+skytext=.(?<skytext>(\w| )+).+feelslike=.(?<feelslike>\d+). humidity=.(?<humidity>\d+). windspeed=.(?<windspeed>\d+). winddisplay=.\d+ mph( (?<winddirection>\w*)|.)");
            //string matchText = Console.ReadLine();
            //Match m = pattern.Match(matchText);
            //Console.WriteLine(m.Success);
            //Console.WriteLine("Temp: {0}", m.Groups["temp"].Value);
            //Console.WriteLine("Skytext: {0}", m.Groups["skytext"].Value);
            //Console.WriteLine("Feelslike: {0}", m.Groups["feelslike"].Value);
            //Console.WriteLine("Humidity: {0}", m.Groups["humidity"].Value);
            //Console.WriteLine("Windspeed: {0}", m.Groups["windspeed"].Value);
            //Console.WriteLine("Winddir: {0}", m.Groups["winddirection"].Value);
        }
    }
}
